<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Header</title><link rel="stylesheet" type="text/css" href="eclipse_book.css"><meta name="generator" content="DocBook XSL Stylesheets V1.77.1"><link rel="home" href="index.html" title="Red Hat Fuse Tooling"><link rel="up" href="RiderExLang.html" title="Part&nbsp;III.&nbsp;Expression and Predicates Languages"><link rel="prev" href="Groovy.html" title="Groovy"><link rel="next" href="JavaScript.html" title="JavaScript"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="Header"></a>Header</h2></div></div></div><div class="simplesect"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="topic-33656"></a>Overview</h2></div></div></div><p>The header language provides a convenient way of accessing header values in the current
message. When you supply a header name, the header language performs a case-insensitive lookup
and returns the corresponding header value.</p><p>The header language is part of <code class="literal">camel-core</code>.</p></div><div class="simplesect"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="topic-33657"></a>XML example</h2></div></div></div><p>For example, to resequence incoming exchanges according to the value of a
<code class="literal">SequenceNumber</code> header (where the sequence number must be a positive integer),
you can define a route as follows:</p><pre class="screen">&lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
  &lt;route&gt;
    &lt;from uri="<span class="emphasis"><em>SourceURL</em></span>"/&gt;
    &lt;resequence&gt;
      &lt;language language="header"&gt;SequenceNumber&lt;/language&gt;
    &lt;/resequence&gt;
    &lt;to uri="<span class="emphasis"><em>TargetURL</em></span>"/&gt;
  &lt;/route&gt;
&lt;/camelContext&gt;</pre></div><div class="simplesect"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="topic-33658"></a>Java example</h2></div></div></div><p>The same route can be defined in Java, as follows:</p><pre class="screen">from("<span class="emphasis"><em>SourceURL</em></span>")
  .resequence(header("SequenceNumber"))
  .to("<span class="emphasis"><em>TargetURL</em></span>");</pre></div></div></body></html>